home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- +
- + LEDA 3.1c
- +
- +
- + _awindow.c
- + written by Kay Drangmeister <K.Drangmeister@insider.sub.de>
- +
- *******************************************************************************/
-
-
-
- // basic graphic routines for libWx declared in <LEDA/impl/x_basic.h>
- // implemented using Amiga functions
-
-
- #include "impl_x_basic.h"
-
-
- #include <math.h>
- #include <string.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <values.h>
-
- /* limits.h defines this: */
- #undef LONGBITS
- #undef BITSPERBYTE
- #undef MAXINT
- #undef MININT
- extern "C" {
- #include <exec/memory.h>
- #include <exec/libraries.h>
- #include <intuition/intuition.h>
- #include <intuition/classusr.h>
- #include <intuition/screens.h>
- #include <graphics/text.h>
- #include <dos/dos.h>
-
- #include <inline/stubs.h>
- #include <inline/exec.h>
- #include <inline/graphics.h>
- #include <inline/intuition.h>
- #include <inline/diskfont.h>
- #include <inline/dos.h>
- #include <clib/alib_protos.h>
- }
-
- #undef TRACE
-
- // window title, max strlen
- #define TITLELEN 99
-
- //#define TRACE
-
-
- #ifdef TRACE
- #define DPRINT(x) printf x
- #else
- #define DPRINT(x)
- #endif
- #define EPRINT(x)
- #define CPRINT(x) printf x
-
- typedef struct {
- struct Window * win;
- struct RastPort * rp;
- int bg_col;
- WORD borl,bort;
- struct TmpRas tr;
- UBYTE * trb; /* tmpras buffer */
- ULONG trs; /* tmpras size */
- ULONG rpn; /* update indicator for color, drawmode, etc. */
- char Title[TITLELEN+1];
- } IWindow;
-
-
- typedef struct {
- ULONG width;
- ULONG height;
- ULONG depth;
- ULONG modeID;
- ULONG Overscan;
- ULONG AutoScroll;
- struct TextAttr TextFontAttr;
- struct TextAttr BoldFontAttr;
- struct TextAttr MsgFontAttr;
- STRPTR X11_Color_Base;
- BOOL Picasso_Kludge;
- } LedaPrefs;
-
- static LedaPrefs pr;
-
- struct DosLibrary *DOSBase=NULL;
- struct IntuitionBase *IntuitionBase=NULL;
- struct GfxBase *GfxBase=NULL;
- struct Library * DiskfontBase=NULL;
- static struct Screen * ascr=NULL;
- static struct RastPort allrp;
- //static struct ColorMap * acm=NULL;
- static ULONG allrpn=0;
- struct IntuiMessage ievent;
- struct IWindow * ieventwin;
- static BOOL eventagain=FALSE;
-
- #define forall_windows(x) \
- IWindow **wp=warray; \
- for(wp=warray,x=*wp++;x!=NULL;x=*wp++)
-
- struct IWindow * warray[16]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
- ULONG warrcnt=0;
- ULONG wsigmask=0; // 1<<w->win->UserPort->mp_SigBit of every window
-
- struct TextAttr DefFontAttr= {"topaz.font",8,FS_NORMAL,FPF_ROMFONT};
- //struct TextAttr TextFontAttr= {"courier.font",13,FS_NORMAL,FPF_DISKFONT};
- //struct TextAttr BoldFontAttr= {"courier.font",13,FSF_BOLD,FPF_DISKFONT};
- //struct TextAttr MsgFontAttr= {"courier.font",15,FS_NORMAL,FPF_DISKFONT};
- static struct TextFont * def_font=NULL;
- static struct TextFont * text_font=NULL;
- static struct TextFont * bold_font=NULL;
- static struct TextFont * mesg_font=NULL;
- static struct TextFont * current_font=NULL;
- static int mesg_char_width;
- static int bold_char_width;
- static int text_char_width;
- static int current_char_width;
-
- static int LINESTYLE = 0;
- static int MODE = 0;
- static int COLOR = 1;
-
- static int MAX_COLORS;
- const int MAX_MAX_COLORS=256; // only supporting 8 bit screens...
- static unsigned long color_pix[MAX_MAX_COLORS];
- static char* color_name[MAX_MAX_COLORS];
- static int color_count= 0;
-
- static UWORD pens[]={14,0,1,13,15,2,1,14,3,9,14,15,0xFFFF};
-
- static int a_drawmode;
- static int a_linewidth;
- static int a_linestyle;
-
-
-
-
-
-
- #define SetLineStyle(rp,style) (rp)->LinePtrn=(style)
- #define SOLID 0xFFFF
- #define DASHED 0xF0F0
- #define DOTTED 0x5555
- #define SetMask(rp,mask) (rp)->Mask=(mask)
- #define ResetMask(rp) (rp)->Mask=~0
- #define SetLineWidth(i) a_linewidth=i
-
- inline void ALine(struct RastPort * rp,WORD x1,WORD y1,WORD x2,WORD y2)
- {
- int i;
- if(pr.Picasso_Kludge)
- {
- // lines must be drawn in one direction only
- // since line(a,b) != line(b,a)
- if(x1>x2) {WORD t=x1;x1=x2;x2=t;t=y1;y1=y2;y2=t;}
- }
- if(a_linewidth==1)
- {
- Move(rp,x1,y1);
- Draw(rp,x2,y2);
- }
- else
- {
- for(i=0;i<a_linewidth;i++)
- {
- Move(rp,x1+i,y1);
- Draw(rp,x2+i,y2);
- Move(rp,x1-i,y1);
- Draw(rp,x2-i,y2);
- Move(rp,x1,y1+i);
- Draw(rp,x2,y2+i);
- Move(rp,x1,y1-i);
- Draw(rp,x2,y2-i);
-
- Move(rp,x1+i,y1+i);
- Draw(rp,x2+i,y2+i);
- Move(rp,x1-i,y1+i);
- Draw(rp,x2-i,y2+i);
- Move(rp,x1+i,y1-i);
- Draw(rp,x2+i,y2-i);
- Move(rp,x1-i,y1-i);
- Draw(rp,x2-i,y2-i);
- }
- }
- }
-
- inline void ARect(struct RastPort * rp,WORD x1,WORD y1,WORD x2,WORD y2)
- {
- int i;
- if(a_linewidth==1)
- {
- Move(rp,x1,y1);
- Draw(rp,x1,y2);
- Draw(rp,x2,y2);
- Draw(rp,x2,y1);
- Draw(rp,x1,y1);
- }
- else
- {
- for(i=0;i<a_linewidth/2;i++)
- {
- Move(rp,x1+i,y1+i);
- Draw(rp,x1+i,y2-i);
- Draw(rp,x2-i,y2-i);
- Draw(rp,x2-i,y1+i);
- Draw(rp,x1+i,y1+i);
-
- Move(rp,x1-i,y1-i);
- Draw(rp,x1-i,y2+i);
- Draw(rp,x2+i,y2+i);
- Draw(rp,x2+i,y1-i);
- Draw(rp,x1-i,y1-i);
- }
- }
- }
-
- inline void SetFg(struct RastPort * rp,UBYTE pen)
- {
- SetAPen(rp,pen);
- /*
- if(rp->DrawMode==COMPLEMENT)
- SetMask(rp,pen&7);
- else
- ResetMask(rp);
- */
- }
-
- inline void SetDM(struct RastPort * rp,UBYTE dm)
- {
- SetDrMd(rp,dm);
- /*
- if(dm==COMPLEMENT)
- SetMask(rp,(rp->FgPen)&7);
- else
- ResetMask(rp);
- */
- }
-
- inline void SetDMFg(struct RastPort * rp,UBYTE dm,UBYTE pen)
- {
- SetDrMd(rp,dm);
- SetAPen(rp,pen);
- /*
- if(dm==COMPLEMENT)
- SetMask(rp,pen&7);
- else
- ResetMask(rp);
- */
- }
-
- inline void ResetDMFg(struct RastPort * rp)
- {
- UBYTE dm=a_drawmode;
- UBYTE pen=color_pix[COLOR];
- SetDrMd(rp,dm);
- SetAPen(rp,pen);
- /*
- if(dm==COMPLEMENT)
- SetMask(rp,pen&7);
- else
- ResetMask(rp);
- */
- }
-
-
- #define UPDATE(win) \
- if(((IWindow *)(win))->rpn != allrpn) \
- UpdateRP((IWindow *)(win));
-
- #define UPDATEON allrpn++
-
- static void UpdateRP(struct IWindow * w)
- {
- SetDrMd(w->rp,a_drawmode);
- SetAPen(w->rp,color_pix[COLOR]);
- DPRINT((" UPDATE:using pen #%d\n",color_pix[COLOR]));
- SetLineStyle(w->rp,a_linestyle);
- w->rpn=allrpn;
- }
-
- //
- // prefs einlesen
- //
-
- ULONG NamedModeID(char * name)
- {
- static unsigned char buf[200];
- ULONG id;
- APTR hd;
- id=INVALID_ID;
- for(;;)
- {
- id=NextDisplayInfo(id);
- if(id==INVALID_ID)
- break;
- hd=FindDisplayInfo(id);
- GetDisplayInfoData(hd,buf,199,DTAG_NAME,0);
- if(strcmp((char *)&(((struct NameInfo *)buf)->Name),name)==0)
- {
- return id;
- }
- }
- return 0;
- }
-
- void ReadPrefs(void)
- {
- static char buf[2048];
- static char *entry[17];
- BPTR fh;
- int pref_lines;
- strcpy(buf,"17\n|1024\n|768\n|5\n|PAL:LowRes\n|1\n|0\n|courier.font\n|13\n|0\n|courier.font\n|13\n|1\n|courier.font\n|15\n|0\n|usr:lib/X11/rgb.txt\n|0\n");
- DPRINT(("reading prefs...\n"));
- if((fh=Open("ENV:LEDAGUI",MODE_OLDFILE))!=NULL)
- {
- Read(fh,buf,2047);
- Close(fh);
- DPRINT((" loaded\n"));
- }
- char * s=buf;
- char c;
- while((c=*s)!='#')
- {
- if(c=='\n')
- *s=0;
- s++;
- }
- s=buf;
- pref_lines=atol(s);
- for(int i=0;i<pref_lines;i++)
- {
- while(*s++!='|');
- entry[i]=s;
- }
- pr.width=atol(entry[0]);
- pr.height=atol(entry[1]);
- pr.depth=atol(entry[2]);
- pr.modeID=NamedModeID(entry[3]);
- pr.Overscan=atol(entry[4]);
- pr.AutoScroll=atol(entry[5]);
- pr.TextFontAttr.ta_Name=entry[6];
- pr.TextFontAttr.ta_YSize=atol(entry[7]);
- pr.TextFontAttr.ta_Style=atol(entry[8]);
- pr.TextFontAttr.ta_Flags=FPF_DISKFONT;
- pr.BoldFontAttr.ta_Name=entry[9];
- pr.BoldFontAttr.ta_YSize=atol(entry[10]);
- pr.BoldFontAttr.ta_Style=atol(entry[11]);
- pr.BoldFontAttr.ta_Flags=FPF_DISKFONT;
- pr.MsgFontAttr.ta_Name=entry[12];
- pr.MsgFontAttr.ta_YSize=atol(entry[13]);
- pr.MsgFontAttr.ta_Style=atol(entry[14]);
- pr.MsgFontAttr.ta_Flags=FPF_DISKFONT;
- pr.X11_Color_Base=entry[15];
- pr.Picasso_Kludge=atol(entry[16]);
- }
-
-
-
-
- static int get_char_width(struct TextFont * f)
- {
- DPRINT(("- get_char_width()=%d\n",f->tf_XSize));
- return f->tf_XSize;
- }
-
- void open_display(void)
- {
- DPRINT(("- open_display()\n"));
- if(ascr!=NULL) return;
-
- DOSBase=(struct DosLibrary *)OpenLibrary((UBYTE *)"dos.library",37);
- IntuitionBase=(struct IntuitionBase *)OpenLibrary((UBYTE *)"intuition.library",37);
- GfxBase=(struct GfxBase *)OpenLibrary((UBYTE *)"graphics.library",37);
- DiskfontBase=OpenLibrary((UBYTE *)"diskfont.library",37);
- if((DOSBase==NULL)||(IntuitionBase==NULL)||(GfxBase==NULL)||(DiskfontBase==NULL))
- {
- fprintf(stderr,"Can\'t open libraries\n");
- abort();
- }
- ReadPrefs();
-
- ascr=OpenScreenTags(NULL,
- {SA_Depth,pr.depth},
- {SA_Width,pr.width},
- {SA_Height,pr.height},
- {SA_DisplayID,pr.modeID},
- {SA_Overscan,pr.Overscan},
- {SA_AutoScroll,pr.AutoScroll},
- {SA_Type,CUSTOMSCREEN},
- {SA_Pens,(ULONG)pens},
- //{SA_Colors,(ULONG)&coltab},
- {SA_Title,(ULONG)"LEDA GUI © 1994-95 by Kay Drangmeister"},
- //{SA_PubName,(ULONG)"LEDA_pubscreen"},
- {TAG_DONE});
- if(!ascr)
- {
- fprintf(stderr,"Can\'t open Screen\n");
- abort();
- }
- MAX_COLORS=1<<pr.depth;
- //PubScreenStatus(ascr,0);
- //acm=GetColorMap(MAX_COLORS);
- //acm=ascr->ViewPort.ColorMap;
- //if(!acm)
- //{
- // fprintf(stderr,"Can\'t open Colormap\n");
- // abort();
- //}
- //if(AttachPalExtra(acm,&ascr->ViewPort))
- //{
- // fprintf(stderr,"Can\'t open PaletteExtra\n");
- // abort();
- //}
- InitRastPort(&allrp);
-
- def_font=(struct TextFont *)OpenDiskFont(&DefFontAttr);
- text_font=(struct TextFont *)OpenDiskFont(&pr.TextFontAttr);
- if (!text_font)
- {
- fprintf(stderr,"Cannot open text font\n");
- text_font=def_font;
- }
- bold_font=(struct TextFont *)OpenDiskFont(&pr.BoldFontAttr);
- if (!bold_font)
- {
- fprintf(stderr,"Cannot open bold font\n");
- bold_font=def_font;
- }
- mesg_font=(struct TextFont *)OpenDiskFont(&pr.MsgFontAttr);
- if (!mesg_font)
- {
- fprintf(stderr,"Cannot open message font\n");
- mesg_font=def_font;
- }
- SetFont(&allrp,text_font);
-
- //XSetLineAttributes(display,gc,1,LineSolid,CapButt,JoinMiter);
-
- color_count=0;
- new_color("white"); // 0: white
- new_color("black"); // 1: black
- new_color("red"); // 2: red
- new_color("green"); // 3: green
- new_color("blue"); // 4: blue
- new_color("yellow"); // 5: yellow
- new_color("purple"); // 6: violet
- new_color("darkorange"); // 7: orange
- new_color("cyan"); // 8: cyan
- new_color("sienna"); // 9: brown
- new_color("magenta"); //10: pink
- new_color("ForestGreen"); //11: darkgreen
- new_color("CornflowerBlue"); //12: darkblue
- new_color("grey75"); //13: grey1
- new_color("grey60"); //14: grey2
- new_color("grey45"); //15: grey3
-
- set_color(1);
- set_mode(xor_mode);
- set_line_style(solid);
- set_line_width(1);
-
- text_char_width=get_char_width(text_font);
- bold_char_width=get_char_width(bold_font);
- mesg_char_width=get_char_width(mesg_font);
- current_char_width=text_char_width;
- current_font=text_font;
- UPDATEON;
- }
-
- void set_palette(int,int,int,int) { /* not implemented */ }
-
- void set_redraw(LWindow,void (*)()) { /* not implemented */ }
-
- typedef struct {
- char * name;
- ULONG r,g,b;
- } x11rgb;
-
- static x11rgb * LoadColorTable(char * f)
- {
- BPTR fh;
- struct FileInfoBlock * fib;
- x11rgb * coltab=NULL;
- static char line[160];
- fib=(struct FileInfoBlock *)AllocDosObject(DOS_FIB,TAG_DONE);
- if(fib)
- {
- if((fh=Open(f,MODE_OLDFILE))!=NULL)
- {
- ExamineFH(fh,fib);
- int len=fib->fib_Size;
- char *buf=new char[len+1];
- if(buf)
- {
- Read(fh,buf,len);
- DPRINT((" loaded\n"));
- buf[len]=0;
- char *cp=buf;
- char c;
- int l,lines=0;
- while((c=*cp++)!=0)
- {
- if(c=='\n')
- {
- cp[-1]=0;
- lines++;
- }
- }
- coltab=new x11rgb[lines+1];
- if(coltab)
- {
- cp=buf;
- for(l=0;l<lines;l++)
- {
- strcpy(line,cp);
- cp+=strlen(line)+1;
- char *ip=line;
- while(*ip==' '||*ip=='\t') ip++;
- coltab[l].r = atol(ip)*0x01010101;
- while(*ip!=' '&&*ip!='\t') ip++;
- while(*ip==' '||*ip=='\t') ip++;
- coltab[l].g = atol(ip)*0x01010101;
- while(*ip!=' '&&*ip!='\t') ip++;
- while(*ip==' '||*ip=='\t') ip++;
- coltab[l].b = atol(ip)*0x01010101;
- while(*ip!=' '&&*ip!='\t') ip++;
- while(*ip==' '||*ip=='\t') ip++;
- coltab[l].name = new char[strlen(ip)+1];
- strcpy(coltab[l].name,ip);
- }
- coltab[l].r = 0;
- coltab[l].g = 0;
- coltab[l].b = 0;
- coltab[l].name = NULL;
- }
- }
- Close(fh);
- }
- FreeDosObject(DOS_FIB,fib);
- }
- return coltab;
- }
-
- x11rgb * getColor(const char* name)
- {
- DPRINT(("- getColor(%s)=",name));
- static x11rgb *ColorTable=NULL;
- static x11rgb srgb[]={
- {"white", 0xffffffff,0xffffffff,0xffffffff},
- {"black", 0x00000000,0x00000000,0x00000000},
- {"red", 0xffffffff,0x00000000,0x00000000},
- {"green", 0x00000000,0xffffffff,0x00000000},
- {"blue", 0x00000000,0x00000000,0xffffffff},
- {"yellow", 0xffffffff,0xffffffff,0x00000000},
- {"purple", 0x88888888,0x00000000,0xffffffff},
- {"darkorange", 0xdddddddd,0xaaaaaaaa,0x00000000},
- {"cyan", 0x00000000,0xffffffff,0xffffffff},
- {"sienna", 0x55555555,0x44444444,0x00000000},
- {"magenta", 0xffffffff,0x00000000,0xffffffff},
- {"forestgreen", 0x88888888,0xffffffff,0x00000000},
- {"cornflowerblue", 0x88888888,0x55555555,0xffffffff},
- {"grey75", 0xcccccccc,0xcccccccc,0xcccccccc},
- {"grey60", 0x99999999,0x99999999,0x99999999},
- {"grey45", 0x72727272,0x72727272,0x72727272},
- {NULL, 0x00000000,0x00000000,0x00000000},
- };
-
- if(ColorTable==NULL)
- {
- if((ColorTable=LoadColorTable(pr.X11_Color_Base))==NULL)
- {
- ColorTable=srgb;
- }
- }
-
- x11rgb * r=NULL;
- x11rgb * i;
- for(i=ColorTable;i->name!=NULL;i++)
- {
- r=i;
- if(strcmp(name,i->name)==0)
- break;
- }
- DPRINT(("%lx\n",r));
- if(r==NULL) r=&srgb[2];
- return r;
- }
-
- int MyObtainPen(x11rgb * col)
- {
- // should be something like:
- // return ObtainBestPen(acm,col->r,col->g,col->b,OBP_Precision,PRECISION_EXACT,TAG_DONE);
- static int MyObtainPenNum=0;
- int x=MyObtainPenNum;
- if(x<MAX_COLORS)
- {
- MyObtainPenNum++;
- return x;
- }
- else
- return -1;
- }
-
- void MySetColor(int n,x11rgb * col)
- {
- if(((struct Library *)GfxBase)->lib_Version>=39)
- {
- SetRGB32(&ascr->ViewPort,n,col->r,col->g,col->b);
- if(2*n<MAX_COLORS) // if we are in the lower halve, we set corresponding col to inverse (for exor crap)
- {
- SetRGB32(&ascr->ViewPort,MAX_COLORS-1-n,~col->r,~col->g,~col->b);
- }
- }
- else
- {
- SetRGB4(&ascr->ViewPort,n,col->r>>28,col->g>>28,col->b>>28);
- if(2*n<MAX_COLORS) // if we are in the lower halve, we set corresponding col to inverse (for exor crap)
- {
- SetRGB4(&ascr->ViewPort,MAX_COLORS-1-n,~col->r>>28,~col->g>>28,~col->b>>28);
- }
- }
- }
-
- int new_color(const char* name)
- {
- DPRINT(("- new_color(%s)\n",name));
-
- open_display();
-
- // first test if color has been allocated before
- for(int i=0; i < color_count; i++)
- if (strcmp(color_name[i],name)==0)
- break;
- if(i<color_count)
- return i;
-
- // if not, try to allocate it
- if (color_count == MAX_COLORS) return 0;
-
- x11rgb * col;
-
- if (pr.depth==1 && strcmp(name,"white")!=0)
- col=getColor("black");
- else
- col=getColor(name);
-
- int n=MyObtainPen(col);
- if(n==-1) return 0;
-
- MySetColor(n,col);
- DPRINT((" pen %ld=rgb(%ld,%ld,%ld)\n",n,col->r,col->g,col->b));
-
- color_pix[color_count]=n;
- char* p=new char[strlen(name)+1];
- if(p==NULL)
- abort();
- strcpy(p,name);
- color_name[color_count]=p;
- UPDATEON;
- return color_count++;
- }
-
-
-
- LWindow open_window(int x, int y, int width, int height, int bg_col, const char* header,const char* label)
- {
- DPRINT(("- open_window(xy=(%d,%d),wh=(%d,%d),hl=(%s,%s))\n",x,y,width,height,header,label));
- IWindow * w=new IWindow;
- if(w==NULL) abort();
-
- strncpy(w->Title,header,TITLELEN);
- w->win=(struct Window *)OpenWindowTags(NULL,
- {WA_Left,x},{WA_Top,y},
- {WA_InnerWidth,width},{WA_InnerHeight,height},
- {WA_AutoAdjust,TRUE},
- {WA_MinWidth,50},{WA_MinHeight,50},
- //{WA_MaxWidth,10000},{WA_MaxHeight,10000},
- {WA_MouseQueue,3},
- {WA_Flags,WFLG_RMBTRAP|WFLG_DRAGBAR|WFLG_DEPTHGADGET|WFLG_SIZEGADGET|WFLG_SIZEBBOTTOM|WFLG_SMART_REFRESH|WFLG_GIMMEZEROZERO|WFLG_REPORTMOUSE|WFLG_ACTIVATE},
- {WA_IDCMP,IDCMP_MOUSEBUTTONS|IDCMP_MOUSEMOVE|IDCMP_NEWSIZE|IDCMP_RAWKEY|IDCMP_VANILLAKEY},
- {WA_Title,(ULONG)(w->Title)},
- {WA_CustomScreen,(ULONG)ascr},
- {TAG_DONE});
- if(!w->win) abort();
- w->rp=w->win->RPort;
- w->borl=(WORD)(w->win->BorderLeft);
- w->bort=(WORD)(w->win->BorderTop);
- w->trs=RASSIZE(w->win->MaxWidth,w->win->MaxHeight);
- w->trb=AllocRaster(w->win->MaxWidth,w->win->MaxHeight);
- if(!w->trb) abort();
- InitTmpRas(&w->tr,w->trb,w->trs);
- w->rp->TmpRas=&w->tr;
-
- SetDM(w->rp,JAM1);
- w->bg_col=color_pix[bg_col];
- SetRast(w->rp,w->bg_col);
-
- // set w->rp according to allrp ###
- SetFont(w->rp,text_font);
-
- warray[warrcnt++]=w;
- wsigmask|=1<<w->win->UserPort->mp_SigBit;
-
- return (LWindow)w;
- }
-
-
- int display_width(void)
- {
- DPRINT(("- display_width()\n[\n"));
- open_display();
- DPRINT(("]=%ld\n",ascr->Width));
- return ascr->Width;
- }
-
- int display_height(void)
- {
- DPRINT(("- display_height()\n[\n"));
- open_display();
- DPRINT(("]=%ld\n",ascr->Height));
- return ascr->Height;
- }
-
- int display_depth(void)
- {
- DPRINT(("- display_depth()\n[\n"));
- open_display();
- DPRINT(("]=%ld\n",pr.depth));
- return pr.depth;
- }
-
- void flush_display(void)
- {}
-
- void close_display()
- {
- DPRINT(("- close_display()\n"));
-
- if(ascr)
- {
- for(int i=0;i<color_count;i++)
- delete color_name[i];
- CloseFont(mesg_font);
- CloseFont(bold_font);
- CloseFont(text_font);
- CloseFont(def_font);
- //FreeColorMap(acm);
- //PubScreenStatus(ascr,PSNF_PRIVATE); //wait for all visitors ###
- //while(!CloseScreen(ascr));
- CloseScreen(ascr);
- CloseLibrary(DiskfontBase);
- CloseLibrary((Library *)GfxBase);
- CloseLibrary((Library *)IntuitionBase);
- CloseLibrary((Library *)DOSBase);
- }
- }
-
- void close_window(LWindow win)
- {
- IWindow * w=(IWindow *)win;
- DPRINT(("- close_window(%lx)\n",w));
- if(w==NULL) return;
- wsigmask&=~(1<<w->win->UserPort->mp_SigBit);
- warray[--warrcnt]=NULL; // #####
- FreeRaster(w->trb,w->win->MaxWidth,w->win->MaxHeight);
- CloseWindow(w->win);
- }
-
- void clear_window(LWindow win)
- {
- DPRINT(("- clear_window(%lx,%d)\n",win));
- IWindow * w=(IWindow *)win;
- int save_mode=set_mode(0);
- SetRast(w->rp,w->bg_col);
- int save_col=set_color(1);
- rectangle(win,0,0,window_width(win)-1,window_height(win)-1);
- set_color(save_col);
- set_mode(save_mode);
- }
-
-
- void pixel(LWindow win, int x, int y)
- {
- DPRINT(("void pixel(LWindow win, int x, int y)\n"));
- IWindow * w=(IWindow *)win;
- UPDATE(win);
- WritePixel(w->rp,x,y);
- }
-
-
- void pixels(LWindow win, int n, int *x, int *y)
- {
- DPRINT(("void pixels(LWindow win, int n, int *x, int *y)\n"));
- int i;
- for(i=0; i<n; i++)
- pixel(win,x[i],y[i]);
- }
-
-
- void line(LWindow win, int x1, int y1, int x2, int y2)
- {
- DPRINT(("- line()\n"));
- IWindow * w=(IWindow *)win;
- UPDATE(win);
- ALine(w->rp,x1,y1,x2,y2);
- }
-
-
- void rectangle(LWindow win, int x1, int y1, int x2, int y2)
- {
- IWindow * w=(IWindow *)win;
- DPRINT(("- rectangle()\n"));
- int t;
- if(x1>x2) {t=x1;x1=x2;x2=t;}
- if(y1>y2) {t=y1;y1=y2;y2=t;}
- UPDATE(win);
- ARect(w->rp,x1,y1,x2,y2);
- }
-
-
- void box(LWindow win, int x1, int y1, int x2, int y2)
- {
- DPRINT(("void box(LWindow win, int x1, int y1, int x2, int y2)\n"));
- IWindow * w=(IWindow *)win;
- if(x1>x2) {int x=x1;x1=x2;x2=x;}
- if(y1>y2) {int y=y1;y1=y2;y2=y;}
- UPDATE(win);
- RectFill(w->rp,x1,y1,x2,y2);
- }
-
-
- void arc(LWindow win, int x0, int y0, int r1, int r2, double start, double angle)
- {
- DPRINT(("- arc(start=%f,angle=%f)\n",start,angle));
- IWindow * w=(IWindow *)win;
- UPDATE(win);
- if (angle < 0)
- {
- start += angle;
- angle *= -1;
- }
- while(start<0)
- start+=2*M_PI;
- double x,y,rx,ry,a,s,end=start+angle;
- //start=0;end=M_PI/2.0;
- s=M_PI/180;
- x=x0;y=y0;rx=r1;ry=r2;
- Move(w->rp,int(x0+r1*cos(start)),int(y0-r2*sin(start)));
- for(a=start+s;a<end;a+=s)
- {
- Draw(w->rp,int(x0+r1*cos(a)),int(y0-r2*sin(a)));
- }
- Draw(w->rp,int(x0+r1*cos(end)),int(y0-r2*sin(end)));
- }
-
-
- void circle(LWindow win, int x0, int y0, int r)
- {
- DPRINT(("void circle(LWindow win, int x0, int y0, int r)\n"));
- IWindow * w=(IWindow *)win;
- UPDATE(win);
- const int steps=int(sqrt(r*20.0));
- if(pr.Picasso_Kludge && a_drawmode==COMPLEMENT)
- {
- Move(w->rp,x0+r,y0);
- WritePixel(w->rp,x0+r,y0);
- double as=6.283185/steps;
- for(int i=1;i<=steps;i++)
- {
- double a=as*i;
- Draw(w->rp,x0+int(r*cos(a)),y0+int(r*sin(a)));
- }
- }
- else
- {
- DrawEllipse(w->rp,x0,y0,r,r);
- }
- }
-
- void ellipse(LWindow win, int x0, int y0, int r1, int r2)
- {
- DPRINT(("void ellipse(LWindow win, int x0, int y0, int r1, int r2)\n"));
- IWindow * w=(IWindow *)win;
- UPDATE(win);
- DrawEllipse(w->rp,x0,y0,r1,r2);
- }
-
-
- void fill_arc(LWindow win, int x0, int y0, int r1, int r2, double start, double angle)
- {
- DPRINT(("void fill_arc(LWindow win, int x0, int y0, int r1, int r2, double start, double angle)\n"));
- IWindow * w=(IWindow *)win;
- UPDATE(win);
- DrawEllipse(w->rp,x0,y0,r1,r2);
- DrawEllipse(w->rp,x0,y0,r1-2,r2-2);
- }
-
- void fill_circle(LWindow win, int x0, int y0, int r)
- {
- DPRINT(("void fill_circle(LWindow win, int x0, int y0, int r)\n"));
- IWindow * w=(IWindow *)win;
- UPDATE(win);
- if(pr.Picasso_Kludge && a_drawmode==COMPLEMENT)
- {
- for(int i=1;i<=r;i++)
- DrawEllipse(w->rp,x0,y0,i,i);
- }
- else
- {
- UBYTE buf[20]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
- struct AreaInfo ai;
- InitArea(&ai,buf,4);
- w->rp->AreaInfo=&ai;
- AreaEllipse(w->rp,x0,y0,r,r);
- AreaEnd(w->rp);
- }
- }
-
-
- void fill_ellipse(LWindow win, int x0, int y0, int r1, int r2)
- {
- DPRINT(("void fill_ellipse(LWindow win, int x0, int y0, int r1, int r2)\n"));
- IWindow * w=(IWindow *)win;
- UPDATE(win);
- if(pr.Picasso_Kludge && a_drawmode==COMPLEMENT)
- {
- DrawEllipse(w->rp,x0,y0,r1,r2);
- int maxr=r1;if(r2>r1)maxr=r2;
- for(int i=1;i<maxr;i++)
- DrawEllipse(w->rp,x0,y0,i<r1?i:r1,i<r2?i:r2);
- }
- else
- {
- UBYTE buf[20]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
- struct AreaInfo ai;
- InitArea(&ai,buf,4);
- w->rp->AreaInfo=&ai;
- AreaEllipse(w->rp,x0,y0,r1,r2);
- AreaEnd(w->rp);
- }
- }
-
-
- void polygon(LWindow win,int n,int * xcoord,int * ycoord)
- {
- DPRINT(("void polygon(LWindow win,int n,int * xcoord,int * ycoord)\n"));
- int i;
- EPRINT(("- x_draw_polygon(%d)\n",n));
- for(i=0;i<n-1;i++)
- {
- line(win,xcoord[i],ycoord[i], xcoord[i+1],ycoord[i+1]);
- }
- line(win,xcoord[n-1],ycoord[n-1],xcoord[0],ycoord[0]);
- }
-
- void fill_polygon(LWindow win, int n, int *xcoord, int *ycoord)
- {
- DPRINT(("void fill_polygon(LWindow win, int n, int *xcoord, int *ycoord)\n"));
- IWindow * w=(IWindow *)win;
- UPDATE(win);
- struct AreaInfo ai;
- UBYTE *buf;
- int i;
- EPRINT(("- x_draw_filled_polygon(#%d,col:%d)\n",n,col));
- if(pr.Picasso_Kludge && a_drawmode==COMPLEMENT)
- {
- polygon(win,n,xcoord,ycoord);
- }
- else
- {
- if(buf=(UBYTE *)AllocVec((n+1)*5,MEMF_CLEAR))
- {
- InitArea(&ai,buf,(n+1));
- w->rp->AreaInfo=&ai;
- AreaMove(w->rp,xcoord[0],ycoord[0]);
- for(i=1;i<n;i++)
- {
- AreaDraw(w->rp,xcoord[i],ycoord[i]);
- }
- AreaEnd(w->rp);
- FreeVec(buf);
- }
- }
- }
-
-
- void put_text(LWindow win, int x, int y, const char* s, int l, int opaque)
- {
- DPRINT(("- put_text(xy:%d,%d,\"%lx:%s\",opaque:%d)\n",x,y,s,s,opaque));
- IWindow * w=(IWindow *)win;
- UPDATE(win);
- if (l>strlen(s)) l=strlen(s);
- if(opaque)
- {
- SetDM(w->rp,JAM2);
- }
- else
- {
- SetDM(w->rp,a_drawmode);
- }
- Move(w->rp,x,y+w->rp->Font->tf_Baseline);
- Text(w->rp,s,l);
- ResetDMFg(w->rp);
- }
-
- void put_text(LWindow win, int x, int y, const char* s, int opaque)
- {
- DPRINT(("- put_text(xy:%d,%d,\"%lx:%s\",opaque:%d)\n",x,y,s,s,opaque));
- IWindow * w=(IWindow *)win;
- UPDATE(win);
- if(opaque)
- {
- SetDM(w->rp,JAM2);
- }
- else
- {
- SetDM(w->rp,a_drawmode);
- }
- Move(w->rp,x,y+w->rp->Font->tf_Baseline);
- Text(w->rp,s,strlen(s));
- ResetDMFg(w->rp);
- }
-
-
- void put_ctext(LWindow win, int x, int y, const char* s, int opaque)
- {
- DPRINT(("void put_ctext(LWindow win, int x, int y, const char* s, int opaque)\n"));
- x -= text_width(s)/2;
- y -= text_height(s)/2;
- put_text(win,x,y,s,opaque);
- }
-
-
- void show_coordinates(LWindow win, const char* s)
- {
- DPRINT(("- show_coordinates(%s)\n",s));
- put_text(win,window_width(win)-160,2,s,1);
- }
-
-
- int text_width(const char* s)
- {
- struct TextExtent te;
- TextExtent(&allrp,s,strlen(s),&te);
- DPRINT(("- text_width(%s)=%d\n",s,te.te_Width));
- return te.te_Width;
- }
-
-
- int text_height(const char* s)
- {
- struct TextExtent te;
- TextExtent(&allrp,s,strlen(s),&te);
- DPRINT(("- text_height(%s)=%d\n",s,te.te_Height));
- return te.te_Height;
- }
-
-
- void copy_pixrect(LWindow win, int x1, int y1, int x2, int y2, int x, int y)
- {
- CPRINT(("void copy_rect(LWindow win, int x1, int y1, int x2, int y2, int x, int y)\n"));
- #if 0
- int save=set_mode(0); /* src-mode */
- Pixmap P=XCreatePixmap(display,win,x2-x1,y2-y1,DefaultDepth(display,screen));
- XCopyArea(display,win,P,gc, x1,y1,x2-x1,y2-y1,0,0);
- XCopyArea(display,P,win,gc,0,0,x2-x1,y2-y1,x,y);
- set_mode(save);
- #endif
- }
-
- void insert_bitmap(LWindow win, int width, int height, char* data)
- {
- CPRINT(("void insert_bitmap(LWindow win, int width, int height, char* data)\n"));
- #if 0
- int save=set_mode(0);
- Pixmap P=XCreatePixmapFromBitmapData(display,win,data,width,height,
- BlackPixel(display,screen),
- WhitePixel(display,screen),
- DefaultDepth(display,screen));
- XCopyArea(display,P,win,gc,0,0,width,height,0,0);
- set_mode(save);
- #endif
- }
-
-
- void set_header(LWindow win, const char* s)
- {
- DPRINT(("- set_header(%lx,%s)\n",win,s));
- IWindow * w=(IWindow *)win;
- strncpy(w->Title,s,TITLELEN);
- //SetWindowTitles(w->win,(UBYTE *)w->Title,(UBYTE *)~0);
- RefreshWindowFrame(w->win);
- }
-
-
- int set_color(int col)
- {
- //int save=COLOR;
- DPRINT(("- set_color(%ld)=%ld [pen=%ld]\n",col,save,color_pix[col]));
- COLOR=col;
- SetFg(&allrp,color_pix[col]);
- UPDATEON;
- return col;
- }
-
-
- int set_mode(int m)
- {
- int save=MODE;
- MODE=m;
- switch(m)
- {
- case 0:
- a_drawmode=JAM1;
- break;
- case 1:
- a_drawmode=COMPLEMENT;
- break;
- case 2:
- a_drawmode=COMPLEMENT; /* was: OR */
- break;
- default:
- break;
- }
- DPRINT(("- set_mode(%d)=%d [a_dm=%d]\n",m,save,a_drawmode));
- SetDM(&allrp,a_drawmode);
- UPDATEON;
- return save;
- }
-
-
- int load_text_font(const char* font_name)
- {
- CPRINT(("int load_text_font(%s)\n",font_name));
- return true;
- #if 0
- XFontStruct* fp=XLoadQueryFont(display,font_name);
- if (fp)
- { text_font=fp;
- text_char_width=get_char_width(fp);
- }
- return (fp != NULL);
- #endif
- }
-
-
- int load_bold_font(const char* font_name)
- {
- CPRINT(("int load_bold_font(%s)\n",font_name));
- return true;
- #if 0
- XFontStruct* fp=XLoadQueryFont(display,font_name);
- if (fp)
- { bold_font=fp;
- bold_char_width=get_char_width(fp);
- }
- return (fp != NULL);
- #endif
- }
-
-
- int load_message_font(const char* font_name)
- {
- CPRINT(("int load_message_font(%s)\n",font_name));
- return true;
- #if 0
- XFontStruct* fp=XLoadQueryFont(display,font_name);
- if (fp)
- { mesg_font=fp;
- mesg_char_width=get_char_width(fp);
- }
- return (fp != NULL);
- #endif
- }
-
-
- int set_font(const char *fname)
- {
- CPRINT(("int set_font(%s)\n",fname));
- return true;
- #if 0
- XFontStruct* fp=XLoadQueryFont(display,fname);
- if (fp)
- { current_font=fp;
- current_char_width=get_char_width(fp);
- gc_val.font=fp->fid;
- XChangeGC(display,gc,GCFont,&gc_val);
- }
- return (fp != NULL);
- #endif
- }
-
-
- static void SetFonts(struct TextFont * f)
- {
- IWindow *w;
- forall_windows(w)
- SetFont(w->rp,f);
- }
-
- void set_text_font(void)
- {
- DPRINT(("void set_text_font(void)\n"));
- if(current_font!=text_font)
- {
- current_font=text_font;
- SetFonts(current_font);
- current_char_width=text_char_width;
- }
- }
-
-
- void set_bold_font(void)
- {
- DPRINT(("void set_bold_font(void)\n"));
- if(current_font!=bold_font)
- {
- current_font=bold_font;
- SetFonts(current_font);
- current_char_width=bold_char_width;
- }
- }
-
-
- void set_message_font(void)
- {
- DPRINT(("void set_message_font(void)\n"));
- if(current_font!=mesg_font)
- {
- current_font=mesg_font;
- SetFonts(current_font);
- current_char_width=mesg_char_width;
- }
- }
-
-
-
- int set_line_width(int w)
- {
- int save=a_linewidth;
- a_linewidth=w;
- DPRINT(("- set_line_width(%d)=%d\n",w,save));
- UPDATEON;
- return save;
- }
-
-
- int set_line_style(int s)
- {
- int save=LINESTYLE;
- LINESTYLE=s;
- switch(s)
- {
- case 0:
- a_linestyle=SOLID;
- break;
- case 1:
- a_linestyle=DASHED;
- break;
- case 2:
- a_linestyle=DOTTED;
- break;
- default:
- a_linestyle=SOLID;
- break;
- }
- SetLineStyle(&allrp,a_linestyle);
- DPRINT(("- set_line_style(%d)=%d\n",s,save));
- UPDATEON;
- return save;
- }
-
-
- void set_read_gc(void)
- {
- DPRINT(("void set_read_gc(void)\n"));
- #if 0
- XGCValues gc_val0;
- gc_val0.function=GXxor;
- gc_val0.foreground=BlackPixel(display,screen);
- gc_val0.line_style=LineSolid;
- gc_val0.line_width=1;
- XChangeGC(display,gc,GCForeground|GCFunction|GCLineStyle|GCLineWidth,&gc_val0);
- flush_display();
- #endif
- }
-
- void reset_gc(void)
- {
- DPRINT(("void reset_gc(void)\n"));
- #if 0
- XChangeGC(display,gc,GCForeground|GCFunction|GCLineStyle|GCLineWidth,&gc_val);
- flush_display();
- #endif
- }
-
-
- int window_height(LWindow win)
- {
- IWindow *w=(IWindow *)win;
- DPRINT(("- window_height(%lx)=%d\n",win,w->win->GZZHeight));
- return w->win->GZZHeight;
- }
-
- int window_width(LWindow win)
- {
- IWindow *w=(IWindow *)win;
- DPRINT(("- window_width(%lx)=%d\n",win,w->win->GZZWidth));
- return w->win->GZZWidth;
- }
-
-
- void window_position(LWindow win, int *x, int *y)
- {
- DPRINT(("void window_position(LWindow win, int *x, int *y)\n"));
- IWindow *w=(IWindow *)win;
- *x=w->win->LeftEdge;
- *y=w->win->TopEdge;
- }
-
-
- static int handle_event(LWindow *win,int *val,int *x,int *y,unsigned long *t)
- {
- DPRINT(("- handle_event()\n"));
-
- int kind=no_event;
- *win=(LWindow)ieventwin;
- *val=0;
- *x=ievent.MouseX-ieventwin->borl;
- *y=ievent.MouseY-ieventwin->bort;
- *t=ievent.Seconds;
- UWORD qual=ievent.Qualifier;
-
- switch(ievent.Class)
- {
- //case ConfigureNotify:
- // kind=configure_event;
- // *x=event.xconfigure.width;
- // *y=event.xconfigure.height;
- // break;
- case IDCMP_NEWSIZE:
- *x=ieventwin->win->GZZWidth;
- *y=ieventwin->win->GZZHeight;
- kind=configure_event;
- break;
-
- //case DestroyNotify:
- // kind=destroy_event;
- // break;
-
- case IDCMP_MOUSEBUTTONS:
- switch(ievent.Code)
- {
- case SELECTUP:
- *val=1;
- if (qual&IEQUALIFIER_CONTROL)
- *val +=3;
- if (qual&(IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT))
- *val=-*val;
- kind=button_release_event;
- break;
- case MIDDLEUP:
- *val=2;
- if (qual&IEQUALIFIER_CONTROL)
- *val +=3;
- if (qual&(IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT))
- *val=-*val;
- kind=button_release_event;
- break;
- case MENUUP:
- *val=3;
- if (qual&IEQUALIFIER_CONTROL)
- *val +=3;
- if (qual&(IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT))
- *val=-*val;
- kind=button_release_event;
- break;
- case SELECTDOWN:
- *val=1;
- if (qual&IEQUALIFIER_CONTROL)
- *val +=3;
- if (qual&(IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT))
- *val=-*val;
- kind=button_press_event;
- break;
- case MIDDLEDOWN:
- *val=2;
- if (qual&IEQUALIFIER_CONTROL)
- *val +=3;
- if (qual&(IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT))
- *val=-*val;
- kind=button_press_event;
- break;
- case MENUDOWN:
- *val=3;
- if (qual&IEQUALIFIER_CONTROL)
- *val +=3;
- if (qual&(IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT))
- *val=-*val;
- kind=button_press_event;
- break;
- }
- break;
- case IDCMP_RAWKEY: // F1,F2,F3 emulate LMB,MMB,RMB
- switch(ievent.Code)
- {
- case 80 | IECODE_UP_PREFIX:
- *val=1;
- if (qual&IEQUALIFIER_CONTROL)
- *val +=3;
- if (qual&(IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT))
- *val=-*val;
- kind=button_release_event;
- break;
- case 81 | IECODE_UP_PREFIX:
- *val=2;
- if (qual&IEQUALIFIER_CONTROL)
- *val +=3;
- if (qual&(IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT))
- *val=-*val;
- kind=button_release_event;
- break;
- case 82 | IECODE_UP_PREFIX:
- *val=3;
- if (qual&IEQUALIFIER_CONTROL)
- *val +=3;
- if (qual&(IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT))
- *val=-*val;
- kind=button_release_event;
- break;
- case 80:
- *val=1;
- if (qual&IEQUALIFIER_CONTROL)
- *val +=3;
- if (qual&(IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT))
- *val=-*val;
- kind=button_press_event;
- break;
- case 81:
- *val=2;
- if (qual&IEQUALIFIER_CONTROL)
- *val +=3;
- if (qual&(IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT))
- *val=-*val;
- kind=button_press_event;
- break;
- case 82:
- *val=3;
- if (qual&IEQUALIFIER_CONTROL)
- *val +=3;
- if (qual&(IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT))
- *val=-*val;
- kind=button_press_event;
- break;
- }
- break;
-
- //case MotionNotify:
- // *x=event.xmotion.x;
- // *y=event.xmotion.y;
- // kind=motion_event;
- // break;
- case IDCMP_MOUSEMOVE:
- kind=motion_event;
- break;
-
- //case KeyPress:
- // *x=event.xmotion.x;
- // c=0;
- // XLookupString((XKeyEvent*)&event,&c,1, &keysym, &status);
- // *val=c;
- // kind=key_press_event;
- // break;
- case IDCMP_VANILLAKEY:
- *val=ievent.Code;
- kind=key_press_event;
- break;
- }
- return kind;
- }
-
-
- int check_next_event(LWindow *win, int *val, int *x, int *y, unsigned long *t)
- {
- // non-blocking
- IWindow *w;
- DPRINT(("- check_next_event(w=%lx)\n",w));
-
- struct IntuiMessage* msg;
-
- if(eventagain)
- {
- eventagain=FALSE;
- return handle_event(win,val,x,y,t);
- }
-
- forall_windows(w)
- {
- msg=(struct IntuiMessage *)GetMsg(w->win->UserPort);
- if(msg)
- {
- memcpy(&ievent,msg,sizeof(struct IntuiMessage));
- ieventwin=w;
- ReplyMsg((struct Message *)msg);
- return handle_event(win,val,x,y,t);
- }
- }
- return no_event;
- }
-
- int get_next_event(LWindow *win, int *val, int *x, int *y, unsigned long *t)
- {
- // blocking
- IWindow *w;
- DPRINT(("- get_next_event()\n"));
-
- ULONG signals;
- struct IntuiMessage* msg;
-
- if(eventagain)
- {
- eventagain=FALSE;
- return handle_event(win,val,x,y,t);
- }
-
- for(;;)
- {
- forall_windows(w)
- {
- msg=(struct IntuiMessage *)GetMsg(w->win->UserPort);
- if(msg)
- {
- memcpy(&ievent,msg,sizeof(struct IntuiMessage));
- ieventwin=w;
- ReplyMsg((struct Message *)msg);
- return handle_event(win,val,x,y,t);
- }
- }
- signals=Wait(wsigmask);
- }
- }
-
- void put_back_event(void)
- {
- DPRINT(("void put_back_event(void)\n"));
- eventagain=TRUE;
- //XPutBackEvent(display,&event);
- }
-